package org.jeecg.modules.demo.baseordercommodity.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.baseordercommodity.entity.BaseOrderCommodity;
import org.jeecg.modules.demo.baseordercommodity.entity.CommodityMain;
import org.jeecg.modules.demo.baseordercommodity.entity.OrderCommodityInfo;
import org.jeecg.modules.demo.baseordercommodity.entity.SelfMentionCommodity;
import org.jeecg.modules.demo.baseordercommodity.mapper.BaseOrderCommodityMapper;
import org.jeecg.modules.demo.baseordercommodity.service.IBaseOrderCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 订单商品表
 * @Author: jeecg-boot
 * @Date: 2022-02-11
 * @Version: V1.0
 */
@Service
public class BaseOrderCommodityServiceImpl extends ServiceImpl<BaseOrderCommodityMapper, BaseOrderCommodity> implements IBaseOrderCommodityService {
    @Autowired
    private BaseOrderCommodityMapper baseOrderCommodityMapper;

    // 根据订单id查询
    @Override
    public IPage<BaseOrderCommodity> getByOderId(Page<BaseOrderCommodity> page, String orderId) {
        return baseOrderCommodityMapper.getByOderId(page, orderId);
    }

    // 根据订单id查询自提商品列表
    @Override
    public List<SelfMentionCommodity> selectSelfMentionCommodityByOrderId(String orderId) {
        return baseOrderCommodityMapper.selectSelfMentionCommodityByOrderId(orderId);
    }

    // 查询在线订单商品列表
    @Override
    public List<CommodityMain> getOnlineOrderCommodityList(Integer pageNo, Integer pageSize, String storeId, String memberId, String orderStatus) {
        return baseOrderCommodityMapper.getOnlineOrderCommodityList(pageNo, pageSize, storeId, memberId, orderStatus);
    }

    // 根据订单id查询商品列表
    @Override
    public List<OrderCommodityInfo> getCommodityInfoListByOrderId(Integer pageNo, Integer pageSize, String orderId) {
        return baseOrderCommodityMapper.getCommodityInfoListByOrderId(pageNo, pageSize, orderId);
    }
}
